// wrapper/go_wrapper.go
package wrapper

/*
#cgo CXXFLAGS: -std=c++11
#cgo LDFLAGS: -L./wrapper/cplusplus -lcplusplus_wrapper -lstdc++
#include <stdlib.h>
#include "c/c_wrapper.h"
*/
import "C"
import (
	"fmt"
	"unsafe"
)

func SendMsg(msg string) string {
	fmt.Println("sendMsg:", msg)
	cMsg := C.CString(msg)
	defer C.free(unsafe.Pointer(cMsg))

	cResponse := C.send_msg(cMsg)
	goResponse := C.GoString(cResponse)
	fmt.Println("goResponse:", goResponse)
	return goResponse
}
